Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bluetooth service caching #144

Merged
merged 1 commit into from
Aug 12, 2022
Merged

Implement bluetooth service caching #144

merged 1 commit into from
Aug 12, 2022

Conversation

bdraco
Copy link
Collaborator

@bdraco bdraco commented Aug 12, 2022

We now cache the services when reconnecting to reduce the time before we can start talking to the accessory.

The cache is never used when we need to fetch the GATT database or the ble device has changed
between connections.

The naïve address check has been replaced with the ble_device_has_changed helper which knows about
adapter changes.

@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #144 (bedcc46) into main (dfce1a7) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
- Coverage   70.77%   70.74%   -0.03%     
==========================================
  Files          70       70              
  Lines        5854     5862       +8     
==========================================
+ Hits         4143     4147       +4     
- Misses       1711     1715       +4     
Flag Coverage Δ
unittests 70.74% <50.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiohomekit/controller/ble/pairing.py 24.51% <25.00%> (+0.11%) ⬆️
aiohomekit/controller/ble/bleak.py 39.02% <100.00%> (+1.52%) ⬆️
aiohomekit/controller/ble/connection.py 52.94% <100.00%> (+2.94%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bdraco
Copy link
Collaborator Author

bdraco commented Aug 12, 2022

Nanoleaf bulb seems a lot more reliable now. No more failures to turn on because it timed out

@bdraco bdraco marked this pull request as ready for review August 12, 2022 00:28
@bdraco
Copy link
Collaborator Author

bdraco commented Aug 12, 2022

We are effectively side stepping this issue hbldh/bleak#927 as well since we only have to pay to to build that once now

Copy link
Owner

@Jc2k Jc2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@bdraco
Copy link
Collaborator Author

bdraco commented Aug 12, 2022

Thanks.

@bdraco bdraco merged commit 9dd0532 into main Aug 12, 2022
@Jc2k Jc2k deleted the service_cache branch July 25, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants